package com.guojizhuang.topn;

import com.guojizhuang.writable.MerchantInfoWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;
import java.util.Comparator;
import java.util.TreeMap;

public class TopNMapper extends Mapper<LongWritable, Text,LongWritable, Text> {

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String[] name = value.toString().split("\t");
        context.write(new LongWritable(Long.parseLong(name[0])),value);
    }
}
